package database_metadata;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseMetaData_Info {
	// JDBC driver name and database URL
	static final String JDBC_DRIVER = "org.sqlite.JDBC";
	static final String DB_URL = "jdbc:sqlite:d:/sqlite/test.db";

	public static void main(String[] args) {
		try {
			System.out.println("SQLite DBMS");
			Class.forName(JDBC_DRIVER);
			System.out.println("Connecting to database...");
			Connection con = DriverManager.getConnection(DB_URL);
			DatabaseMetaData db = con.getMetaData();
			System.out.println("Batch Updates : "
					+ db.supportsBatchUpdates());
			System.out.println("Correlated Subqueries : "
					+ db.supportsCorrelatedSubqueries());
			System.out.println("GroupBy : " + db.supportsGroupBy());
			System.out.println("Multiple ResultSets : "
					+ db.supportsMultipleResultSets());
			System.out.println("Multiple OpenResults : "
					+ db.supportsMultipleOpenResults());
			System.out.println("OuterJoins : "
					+ db.supportsOuterJoins());
			System.out.println("Savepoints : "
					+ db.supportsSavepoints());
			System.out.println("SelectForUpdate : "
					+ db.supportsSelectForUpdate());
			System.out.println("StoredProcedures : "
					+ db.supportsStoredProcedures());
			System.out.println("SubqueriesInComparisons : "
					+ db.supportsSubqueriesInComparisons());
			System.out.println("SubqueriesInExists : "
					+ db.supportsSubqueriesInExists());
			System.out.println("Transactions : "
					+ db.supportsTransactions());

		} catch (ClassNotFoundException ex) {
			ex.printStackTrace();
		} catch (SQLException ex) {
			ex.printStackTrace();
		}

	}

}
